* Can the Fairer Sex Save the Day? Voting for Women After Corruption Scandals in Latin America
* Replication Code: Descriptive Statistics, Histrograms, SI Regression Models 
* Emily Elia 

/* Import cleaned and fully anonymized data */
use "ScandalsExpData_ANONYMOUS.dta"

/* Table SI.1: Descriptive Stats */  
/* Descriptive Statistics */
sum female if incomplete==0
sum agenum if incomplete==0
sum corrperc if incomplete==0
sum edunum if incomplete==0
sum polint_num if incomplete==0
sum ideology if incomplete==0
sum honestnum if incomplete==0
sum rulesnum if incomplete==0
sum risknum if incomplete==0
sum stereotypescore if incomplete==0
sum vote if incomplete==0
sum trust if incomplete==0

/* Table SI.3, SI.4: Balance Tables */  
/* balancetable creates an excel or tex file of a table of covariate balance across 
treatment and control groups */
ssc install balancetable

balancetable scandal agenum edunum female using "scandalsbaltab_scand.xlsx", vce(robust) pval ctitles("No Scandal" "Scandal" "Difference") tabulary

balancetable candidate agenum edunum female using "scandalsbaltab_sex.xlsx", vce(robust) pval ctitles("Man" "Woman" "Difference") tabulary


/* Figure SI.1: Histograms of corruption perceptions by country */
* corr perc *
hist corrperc if ccode==1 & incomplete==0, /// 
	subtitle("Distribution of Corruption Perceptions, MEX") ///
	fcolor(navy) lcolor(gray) ///
	xtitle("What % of politicians in your country do you think are corrupt?", size(small)) ///
	plotregion(fcolor(white)) graphregion(fcolor(white)) ///
     name(hist_corr_mex, replace)

hist corrperc if ccode==2 & incomplete==0, /// 
	subtitle("Distribution of Corruption Perceptions, GTM") ///
	fcolor(navy) lcolor(gray) ///
	xtitle("What % of politicians in your country do you think are corrupt?", size(small)) ///
	plotregion(fcolor(white)) graphregion(fcolor(white)) ///
     name(hist_corr_gtm, replace)
	 
hist corrperc if ccode==3 & incomplete==0, /// 
	subtitle("Distribution of Corruption Perceptions, CHL") ///
	fcolor(navy) lcolor(gray) ///
	xtitle("What % of politicians in your country do you think are corrupt?", size(small)) ///
	plotregion(fcolor(white)) graphregion(fcolor(white)) ///
     name(hist_corr_chl, replace)
	 
hist corrperc if ccode==4 & incomplete==0, /// 
	subtitle("Distribution of Corruption Perceptions, URY") ///
	fcolor(navy) lcolor(gray) ///
	xtitle("What % of politicians in your country do you think are corrupt?", size(small)) ///
	plotregion(fcolor(white)) graphregion(fcolor(white)) ///
     name(hist_corr_ury, replace)
	 
graph combine hist_corr_mex hist_corr_gtm hist_corr_chl hist_corr_ury, ///
	plotregion(fcolor(white)) graphregion(fcolor(white)) ///
     name(hist_corr_all, replace)

	 
/* Figure SI.2: Histograms of women more honest by country */
* honest *
hist honestnum if ccode==1 & incomplete==0, /// 
	subtitle("Women Are More Honest Than Men, MEX") ///
	fcolor(navy) lcolor(gray) ///
	xtitle("1-Strongly Disagree, 5-Strongly Agree") ///
	plotregion(fcolor(white)) graphregion(fcolor(white)) ///
     name(hist_honest_mex, replace)

hist honestnum if ccode==2 & incomplete==0, /// 
	subtitle("Women Are More Honest Than Men, GTM") ///
	fcolor(navy) lcolor(gray) ///
	xtitle("1-Strongly Disagree, 5-Strongly Agree") ///
	plotregion(fcolor(white)) graphregion(fcolor(white)) ///
     name(hist_honest_gtm, replace)
	 
hist honestnum if ccode==3 & incomplete==0, /// 
	subtitle("Women Are More Honest Than Men, CHL") ///
	fcolor(navy) lcolor(gray) ///
	xtitle("1-Strongly Disagree, 5-Strongly Agree") ///
	plotregion(fcolor(white)) graphregion(fcolor(white)) ///
     name(hist_honest_chl, replace)
	 
hist honestnum if ccode==4 & incomplete==0, /// 
	subtitle("Women Are More Honest Than Men, URY") ///
	fcolor(navy) lcolor(gray) ///
	xtitle("1-Strongly Disagree, 5-Strongly Agree") ///
	plotregion(fcolor(white)) graphregion(fcolor(white)) ///
     name(hist_honest_ury, replace)
	 
graph combine hist_honest_mex hist_honest_gtm hist_honest_chl hist_honest_ury, ///
	plotregion(fcolor(white)) graphregion(fcolor(white)) ///
     name(hist_honest_all, replace)

	 
/* Figure SI.3: Histograms of women more risk averse by country */
* risk averse *
hist risknum if ccode==1 & incomplete==0, /// 
	subtitle("Women Are More Risk Averse Than Men, MEX") ///
	fcolor(navy) lcolor(gray) ///
	xtitle("1-Strongly Disagree, 5-Strongly Agree") ///
	plotregion(fcolor(white)) graphregion(fcolor(white)) ///
     name(hist_risk_mex, replace)

hist risknum if ccode==2 & incomplete==0, /// 
	subtitle("Women Are More Risk Averse Than Men, GTM") ///
	fcolor(navy) lcolor(gray) ///
	xtitle("1-Strongly Disagree, 5-Strongly Agree") ///
	plotregion(fcolor(white)) graphregion(fcolor(white)) ///
     name(hist_risk_gtm, replace)
	 
hist risknum if ccode==3 & incomplete==0, /// 
	subtitle("Women Are More Risk Averse Than Men, CHL") ///
	fcolor(navy) lcolor(gray) ///
	xtitle("1-Strongly Disagree, 5-Strongly Agree") ///
	plotregion(fcolor(white)) graphregion(fcolor(white)) ///
     name(hist_risk_chl, replace)
	 
hist risknum if ccode==4 & incomplete==0, /// 
	subtitle("Women Are More Risk Averse Than Men, URY") ///
	fcolor(navy) lcolor(gray) ///
	xtitle("1-Strongly Disagree, 5-Strongly Agree") ///
	plotregion(fcolor(white)) graphregion(fcolor(white)) ///
     name(hist_risk_ury, replace)
	 
graph combine hist_risk_mex hist_risk_gtm hist_risk_chl hist_risk_ury, ///
	plotregion(fcolor(white)) graphregion(fcolor(white)) ///
     name(hist_risk_all, replace)

	 
/* Figure SI.4: Histograms of women more rule abiding by country */
* rule abiding *
hist rulesnum if ccode==1 & incomplete==0, /// 
	subtitle("Women Are More Rule Abiding Than Men, MEX") ///
	fcolor(navy) lcolor(gray) ///
	xtitle("1-Strongly Disagree, 5-Strongly Agree") ///
	plotregion(fcolor(white)) graphregion(fcolor(white)) ///
     name(hist_rules_mex, replace)

hist rulesnum if ccode==2 & incomplete==0, /// 
	subtitle("Women Are More Rule Abiding Than Men, GTM") ///
	fcolor(navy) lcolor(gray) ///
	xtitle("1-Strongly Disagree, 5-Strongly Agree") ///
	plotregion(fcolor(white)) graphregion(fcolor(white)) ///
     name(hist_rules_gtm, replace)
	 
hist rulesnum if ccode==3 & incomplete==0, /// 
	subtitle("Women Are More Rule Abiding Than Men, CHL") ///
	fcolor(navy) lcolor(gray) ///
	xtitle("1-Strongly Disagree, 5-Strongly Agree") ///
	plotregion(fcolor(white)) graphregion(fcolor(white)) ///
     name(hist_rules_chl, replace)
	 
hist rulesnum if ccode==4 & incomplete==0, /// 
	subtitle("Women Are More Rule Abiding Than Men, URY") ///
	fcolor(navy) lcolor(gray) ///
	xtitle("1-Strongly Disagree, 5-Strongly Agree") ///
	plotregion(fcolor(white)) graphregion(fcolor(white)) ///
     name(hist_rules_ury, replace)
	 
graph combine hist_rules_mex hist_rules_gtm hist_rules_chl hist_rules_ury, ///
	plotregion(fcolor(white)) graphregion(fcolor(white)) ///
     name(hist_rules_all, replace)


/* Table SI.4: Linear regression of candidate sex + scandal on vote likelihood */
regress vote i.condition if ccode==1 & incomplete==0
eststo votemex

regress vote i.condition if ccode==2 & incomplete==0
eststo votegtm

regress vote i.condition if ccode==3 & incomplete==0
eststo votechl 

regress vote i.condition if ccode==4 & incomplete==0
eststo voteury

esttab votemex votegtm votechl voteury using EE_Scandals_Table1Country2.rtf, replace ///
   mtitles("Mexico" "Guatemala" "Chile" "Uruguay") ///
   noabbrev b(%9.3f) se star (* 0.1 ** 0.05 *** 0.01) wrap nogap varwidth(25) align(c) nonumbers

   
/* Table SI.5: Linear regression of candidate sex + scandal + stereotype score on vote likelihood */
regress vote i.condition##c.stereotypescore if ccode==1 & incomplete==0
eststo votessmex2

regress vote i.condition##c.stereotypescore if ccode==2 & incomplete==0
eststo votessgtm2 

regress vote i.condition##c.stereotypescore if ccode==3 & incomplete==0
eststo votesschl2 

regress vote i.condition##c.stereotypescore if ccode==4 & incomplete==0
eststo votessury2 

esttab votessmex2 votessgtm2 votesschl2 votessury2 using EE_Scandals_Table2CountrySS.rtf, replace ///
   mtitles("Mexico" "Guatemala" "Chile" "Uruguay") ///
    coeflabels(condition "Treatment Condition" stereotypescore "Stereotype Score") ///
   noabbrev b(%9.3f) se star (* 0.1 ** 0.05 *** 0.01) wrap nogap varwidth(25) align(c) nonumbers

   
/* Table SI.6: Linear regression of candidate sex + scandal + respondent sex on vote likelihood */
regress vote i.condition##female if ccode==1 & incomplete==0
eststo votefmex2

regress vote i.condition##female if ccode==2 & incomplete==0
eststo votefgtm2 

regress vote i.condition##female if ccode==3 & incomplete==0
eststo votefchl2 

regress vote i.condition##female if ccode==4 & incomplete==0
eststo votefury2 

esttab votefmex2 votefgtm2 votefchl2 votefury2 using EE_Scandals_Table3CountryF.rtf, replace ///
   mtitles("Mexico" "Guatemala" "Chile" "Uruguay") ///
    coeflabels(condition "Treatment Condition" female "Female Respondent") ///
   noabbrev b(%9.3f) se star (* 0.1 ** 0.05 *** 0.01) wrap nogap varwidth(25) align(c) nonumbers

   
/* Table SI.7: Linear regression of candidate sex + scandal with controls age, edu, poli int, ideo, corr perc */
regress vote i.condition edunum agenum ideology polint_num corrperc if ccode==1 & incomplete==0
eststo votemexc

regress vote i.condition edunum agenum ideology polint_num corrperc if ccode==2 & incomplete==0
eststo votegtmc

regress vote i.condition edunum agenum ideology polint_num corrperc if ccode==3 & incomplete==0
eststo votechlc 

regress vote i.condition edunum agenum ideology polint_num corrperc if ccode==4 & incomplete==0
eststo voteuryc

esttab votemexc votegtmc votechlc voteuryc using EE_Scandals_Table1CountryControls.rtf, replace ///
   mtitles("Mexico" "Guatemala" "Chile" "Uruguay") ///
   coeflabels(condition "Treatment Condition" edunum "Education Level" agenum "Age" ideology "Left-Right Ideology" ///
   polint_num "Political Interest" corrperc "Corruption Perception") ///
   noabbrev b(%9.3f) se star (* 0.1 ** 0.05 *** 0.01) wrap nogap varwidth(25) align(c) nonumbers
   

/* Table SI.8: Principal component factors of stereotype questions */
factor honestnum rulesnum risknum, pcf

   
/* Table SI.11: Ordinal logistic regression of candidate sex + scandal on vote likelihood */
ologit vote i.condition if ccode==1 & incomplete==0
eststo votemex2o

ologit vote i.condition if ccode==2 & incomplete==0
eststo votegtm2o 

ologit vote i.condition if ccode==3 & incomplete==0
eststo votechl2o 

ologit vote i.condition if ccode==4 & incomplete==0
eststo voteury2o 

esttab votemex2o votegtm2o votechl2o voteury2o using EE_Scandals_Table1Country2_OLOGIT.rtf, replace ///
   mtitles("Mexico" "Guatemala" "Chile" "Uruguay") ///
   noabbrev b(%9.3f) se star (* 0.1 ** 0.05 *** 0.01) wrap nogap varwidth(25) align(c) nonumbers

   
/* Table SI.12: Ordinal logistic regression of candidate sex + scandal + respondent sex on vote likelihood */
ologit vote i.condition##female if ccode==1 & incomplete==0
eststo votemex2o2

ologit vote i.condition##female if ccode==2 & incomplete==0
eststo votegtm2o2 

ologit vote i.condition##female if ccode==3 & incomplete==0
eststo votechl2o2 

ologit vote i.condition##female if ccode==4 & incomplete==0
eststo voteury2o2 

esttab votemex2o2 votegtm2o2 votechl2o2 voteury2o2 using EE_Scandals_Table1Country2_OLOGITSEX.rtf, replace ///
   mtitles("Mexico" "Guatemala" "Chile" "Uruguay") ///
   noabbrev b(%9.3f) se star (* 0.1 ** 0.05 *** 0.01) wrap nogap varwidth(25) align(c) nonumbers

   
/* Table SI.13: Ordinal logistic regression of candidate sex + scandal + stereotype score on vote likelihood */
ologit vote i.condition##c.stereotypescore if ccode==1 & incomplete==0
eststo votemex2o3

ologit vote i.condition##c.stereotypescore if ccode==2 & incomplete==0
eststo votegtm2o3 

ologit vote i.condition##c.stereotypescore if ccode==3 & incomplete==0
eststo votechl2o3 

ologit vote i.condition##c.stereotypescore if ccode==4 & incomplete==0
eststo voteury2o3 

esttab votemex2o3 votegtm2o3 votechl2o3 voteury2o3 using EE_Scandals_Table1Country2_OLOGITSS.rtf, replace ///
   mtitles("Mexico" "Guatemala" "Chile" "Uruguay") ///
   noabbrev b(%9.3f) se star (* 0.1 ** 0.05 *** 0.01) wrap nogap varwidth(25) align(c) nonumbers

